<?php
namespace Platform\Model;

use PhalApi\Model\DataModel;

class SystemMenu extends DataModel {

    public function getTableName($id) {
        return 'menu';
    }

    public function getAllMenus() {
        return $this->getORM()
            ->order('sort_num')
            ->fetchAll();
    }    
    
    public function listAllMenus() {
        return $this->getORM()
        ->where(array('delete_flag'=>'N'))
        ->select('id,id as authorityId,title,name,sort_num,parent_id as parentId,icon,path,url,depth')
        ->order('parent_id, sort_num')
        ->fetchAll();
    }
}

